//
// Module.h
// Usage: Kernel module (*.ko) object
// CreateDate: 2009-04-09
// Author: MaJiuyue
//
#ifndef _MODULE_H_
#define _MODULE_H_

#include "type.h"
#include "UString.h"
#include "../schedule/Process.h"

class Module
{
private:
	/* Module name */
	String m_ModuleName;
	/* Module's virtual address(in kernel's address space) */
	addr_t m_ModuleAddress;
	/* Module's size */
	size_t m_ModuleSize;

public:
	Module(const char * strModuleName, addr_t ModuleAddress, size_t ModuleSize);
	~Module();

public:
	/* 
		Create a `root process' using this module, if succeed return
		process descriptor, else return NULL.
		The created process have the process id of pid.
		The created process use the process pid0 as it's parent. 
	*/
	Process * CreateProcess();

	const char * GetModuleName() { return m_ModuleName.c_str(); }
};

#endif

